<%@ page contentType="text/html; charset=ISO-8859-1" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:useBean id="db" class="db.Conexion" scope="session"/>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Sistema de notificaci&oacute;n de Pagos a Proveedores JDE - FCC Construcci&oacute;n de CA, S.A</title>
<style type="text/css">
.textfield
{
	width:200px;
	font-family:Verdana, Geneva, sans-serif;
	font-size:11px;
}
.textfield_no_editable
{
	width:120px;
	font-family:Verdana, Geneva, sans-serif;
	font-size:11px;
	background-color:#DFDFDF;
}
.bordes
{
	border:1px solid #000;
	border-collapse:collapse;
}
</style>
<!--DIALOGO-->
<link type="text/css" href="/jde/scripts/ui/base/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="/jde/scripts/ui/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/jquery.bgiframe-2.1.1.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.resizable.js"></script>
<script type="text/javascript" src="/jde/scripts/ui/ui/jquery.ui.dialog.js"></script>
<!--MENU-->
<link rel="stylesheet" href="/jde/scripts/menu/menu-bar.css" media="screen" type="text/css"/>
<script type="text/javascript" src="/jde/scripts/menu/menu-for-applications.js"></script>
<link rel="stylesheet" href="/jde/scripts/menu/menu-item.css" media="screen" type="text/css"/>
<script language="javascript" type="text/javascript" src="script.js"></script>
<script language="javascript" type="text/javascript">
window.onload = function()
{
	Reloj();
	var menuModel = new DHTMLSuite.menuModel();
	menuModel.addItemsFromMarkup('menuModel');
	menuModel.setMainMenuGroupWidth(00);
	menuModel.init();
	var menuBar = new DHTMLSuite.menuBar();
	menuBar.addMenuItems(menuModel);
	menuBar.setTarget('menu');
	menuBar.init();
	//LIMPIAR FORMULARIO
	document.getElementById('form1').reset();
	//CARGAR COMPANIA DEL USUARIO
	<%
	if ((db.ObtenerEstadoSQLServer().equals("desconectado"))||(db.ObtenerEstadoSQLServer() == null))
		out.write("window.location=\"/jde/Pagos/?sesion_finalizada=ok\";");
	else
	{
		boolean acceso_todas_cias = db.AccesoTodasCompanias();
		boolean companias_multiples = db.CompaniasMultiplesUsuario();
		if (acceso_todas_cias == true)
			out.write("\t"+"document.getElementById('boton_compania').style.visibility = \"visible\";"+"\n");
		if (companias_multiples == true)
			out.write("\t"+"document.getElementById('boton_compania').style.visibility = \"visible\";"+"\n");
		if ((acceso_todas_cias == false)&&(companias_multiples == false))
		{
			String compania = db.ObtenerCompaniaUsuario();
			String codigo_compania = db.ObtenerCodigoCompania(compania);
			out.write("\t"+"document.getElementById('boton_compania').style.display = \"none\";"+"\n");
			out.write("\t"+"document.getElementById('compania').value = \""+compania+"\";"+"\n");
			out.write("\t"+"document.getElementById('codigo_compania').value = \""+codigo_compania+"\";"+"\n");
			out.write("\t"+"CargarFormulario();"+"\n");
		}
	}
	%>
};

function Reloj()
{
	var fecha = new Date ();
  	var hora = fecha.getHours ( );
  	var minuto = fecha.getMinutes ( );
  	var segundo = fecha.getSeconds ( );
  	minuto = (minuto < 10 ? "0" : "") + minuto;
  	segundo = (segundo < 10 ? "0" : "") + segundo;
  	var tiempo = (hora < 12 ) ? "A.M" : "P.M";
  	hora = (hora > 12) ? hora - 12 : hora;
  	hora = (hora == 0) ? 12 : hora;
  	var cadena_hora = hora + ":" + minuto + ":" + segundo + " " + tiempo;
  	document.getElementById("reloj").innerHTML = "<b>"+cadena_hora+"</b>";
	setTimeout("Reloj()",1000);
}
</script>
</head>
<body style="font-family:Verdana, Geneva, sans-serif; font-size:11px;">
<div id="atencion" title="Atenci&oacute;n"></div>
<%
//COMPROBAR CONEXION
if ((db.ObtenerEstadoSQLServer().equals("desconectado"))||(db.ObtenerEstadoSQLServer() == null))
{
	out.write("<script language=\"javascript\" type=\"text/javascript\">"+"\n"+
	"<!--"+"\n"+
	"window.location=\"/jde/Pagos/?sesion_finalizada=ok\""+"\n"+
	"-->"+"\n"+
	"</script>");
}
else
{
	java.sql.Connection conex = db.ObtenerConexionSQLServer();
	if (conex.isClosed() == false)
	{
%>
<jsp:include page="/Pagos/home/top.jsp"/>
<div id="atencion" title="Atenci&oacute;n"></div>
<div id="confirmacion" title="Confirmaci&oacute;n"></div>
<div id="procesando" title="Procesando"></div>
<div id="registros" title="Registros"></div>
<div style="width:100%;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td width="100%" align="left">DATOS DE LA SESI&Oacute;N (<%=db.ObtenerUsuarioFull()%>, Hora: <span id="reloj"></span>)</td>
</tr>
</table>
</div>
<div id="todo" style="background-image:url(/jde/img/logo_fondo.png); height:250px; background-repeat:no-repeat; background-position:center;">
	<div style="text-align:center; font-weight:bold; background-color:#99ffcc; border:1px solid #666; padding:4px 4px 4px 3px; text-align:center;">NOTIFICAR PAGO A PROVEEDORES
	</div>
	<div style="margin-bottom:5px; border:1px solid #666; padding:4px 4px 4px 3px; text-align:center;">
	<a href="javascript:Evaluar();" class="menu_top">
	<img src="/jde/img/check.png" alt="Notificar" width="24" height="24" border="0" align="absmiddle" />&nbsp;Notificar
	</a>&nbsp;
	<a href="javascript:LimpiarFormulario();" class="menu_top">
	<img src="/jde/img/limpiar.png" alt="Limpiar formulario" width="24" height="24" border="0" align="absmiddle" />&nbsp;Limpiar formulario
	</a>&nbsp;
	<a href="javascript:Cancelar();" class="menu_top">
	<img src="/jde/img/cancelar.png" alt="Cancelar" width="24" height="24" border="0" align="absmiddle" />&nbsp;Cancelar
	</a>
	</div>
	<div id="evaluacion" style="text-align:center;">
	</div>
	<form id="form1" method="post" action="/jde/Pagos/Formularios/NotificarPago">
	<input type="hidden" id="codigo_compania" name="codigo_compania" />
	<input type="hidden" id="cantidad_proveedores" name="cantidad_proveedores" />
	<table border="0" cellspacing="3" cellpadding="0" align="center">
	<tr>
		<td align="rihgt">Compa&ntilde;&iacute;a:</td>
		<td align="left"><input type="text" name="compania" class="textfield_no_editable" readonly="true" style="width:400px;" id="compania" onmouseover="ToolTip(this);"/>&nbsp;
		<a href="javascript:CargarCompanias();" class="menu_top">
		<img id="boton_compania" src="/jde/img/buscar.png" alt="Buscar" width="16" height="16" border="0" align="absmiddle" /></a></td>
	</tr>
	</table>
	<div id="formulario" style="margin-top:10px; margin-bottom:30px;">
	</div>
	</form>
</div>
<%
	}
	else
	{
		out.write("<script language=\"javascript\" type=\"text/javascript\">"+"\n"+
		"<!--"+"\n"+
		"window.location=\"/jde/Pagos/?sesion_finalizada=ok\""+"\n"+
		"-->"+"\n"+
		"</script>");
	}

}
%>
</body>
</html>